use rocket::serde::json::Json;
use rocket_okapi::openapi;
use serde_json::Value;
use crate::business::remote::openai_remote_manager::OpenAiRemoteManager;
use crate::extends::core::response::reponse_data::R;
use crate::extends::utils::json_util::JsonUtil;
use crate::extends::utils::request_util::RequestUtil;

#[openapi(tag = "远程接口管理")]
#[get("/admin/remote/health")]
pub async fn health() -> Json<R<Value>> {
    let result = OpenAiRemoteManager::health().await;

    // 从 result 中提取 code 字段
    let msg = result.get("msg").cloned().unwrap_or(Value::Null);
    println!("{:?}",msg);
    return R::success(Some(result));
}

